<template lang="html">
  <el-form
    ref="form"
    class="page-header"
    :inline="true"
    :model="form"
    label-suffix=":"
    label-width="auto"
  >
    <el-row :gutter="10">
      <!-- <el-col :xs="8" :sm="6" :md="5">
        <el-form-item label="所属部门" prop="organize">
          <input-tree-select v-model="form.organize" type="organize" @change="doSearch" />
        </el-form-item>
      </el-col> -->
      <el-col :xs="8" :sm="6" :md="5">
        <el-form-item label="登录名" prop="userName">
          <el-input v-model="form.userName" placeholder="请输入" @keyup.enter.native="doSearch" />
        </el-form-item>
      </el-col>
      <el-col :xs="8" :sm="6" :md="5">
        <el-form-item label="姓名" prop="nickName">
          <el-input v-model="form.nickName" placeholder="请输入" @keyup.enter.native="doSearch" />
        </el-form-item>
      </el-col>
      <el-col :xs="8" :sm="6" :md="5">
        <el-form-item label="用户状态" prop="state">
          <el-select v-model="form.state" placeholder="请选择" clearable @change="doSearch">
            <el-option
              v-for="item in [
                { label: '启用', value: 1 },
                { label: '停用', value: 0 },
              ]"
              :key="item.value"
              :label="item.label"
              :value="item.value"
            />
          </el-select>
        </el-form-item>
      </el-col>
      <el-col :xs="8" :sm="6" :md="4">
        <div style="width: 200px">
          <el-button icon="el-icon-search" @click="doSearch">搜索</el-button>
          <el-button icon="el-icon-refresh" @click="doReset">重置</el-button>
        </div>
      </el-col>
    </el-row>
  </el-form>
</template>

<script>
import pageHeaderMixin from "mixins/pageHeaderMixin";

export default {
  mixins: [pageHeaderMixin],
  data() {
    return {
      form: {
        loginName: "",
        userName: "",
        userStatus: "",
        // organize: "",
      },
    };
  },
  methods: {
    // formDataFormat() {
    //   const { organize, ...rest } = this.form;
    //   return { ...rest, ...(organize && { deptId: JSON.parse(organize)[0].value }) };
    // },
  },
};
</script>
